//
// ssfm.c
// NLSE Solver, Created by jmpp on 9/2/10.
// $Id: ssfm.c 16 2010-11-03 14:19:32Z jmpalacios $

/**
* =================================================================
* Copyright (C) 2010, Juan Manuel Palacios. All Rights Reserved.
*
* This software project, which includes this module, is licensed
* as described in the file LICENSE, which you should have received
* as part of this distribution, and may be used only according to
* the terms described therein.
*
* =================================================================
**/


#include "ssfm.h"
#include <stdlib.h>
// this is of course only necessary for placeholder code!
#include <GLUT/glut.h>


// this is of course a temporary prototype!
SSFMInput *ssfm_init(ssfm_uinteger fft_points)
{
    
    SSFMInput *input_vector = malloc(sizeof(*input_vector));
    
    return input_vector;
}


// this is of course a temporary prototype!
void ssfm_analysis(GLsizei width, GLsizei height, GLfloat *color)
{
    
    // All of this is of course temporary code!
    
    glViewport(0,0,width,height);
    
    glClearColor(color[0],color[1],color[2],color[3]);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    
    glTranslatef(0.0f,0.0f,-1.0f);
    
    glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE,color);
    glutSolidTeapot(0.5);    
    
    return;
}


void ssfm_destroy(SSFMInput *data)
{
    
    if (data)
    {
        free(data);
    }
    
    return;
}
